package com.nk.web.interceptor;

import com.nk.utils.RequestUtils;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class RequestInterceptor implements HandlerInterceptor {

    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        System.out.println("来到了拦截器");
        // 把当前请求保存到本地变量中
        RequestUtils.setRequest(request);
        return true;
    }

}
